package com.wanmait.mavendemo.service.impl;
import com.wanmait.mavendemo.dao.QuestionTypeDAO;
import com.wanmait.mavendemo.mapper.QuestionTypeMapper;
import com.wanmait.mavendemo.pojo.QuestionType;
import com.wanmait.mavendemo.service.QuestionTypeService;
import com.wanmait.mavendemo.util.Pager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional(rollbackFor =Exception.class)
public class QuestionTypeServiceImpl implements QuestionTypeService {
    private  static final Logger logger= LogManager.getLogger(QuestionTypeServiceImpl.class);
    @Resource
    private QuestionTypeMapper questionTypeMapper;

    @Override
    public void updateSort(Integer id, Integer sort) {

    }

    @Override
    public void increaseQuestionCount(Integer id) {

    }

    @Override
    public void decreaseQuestionCount(Integer id) {

    }

    @Override
    public List<QuestionType> findAll() {
        logger.debug("degbug...........");
        logger.info("info..............");
        logger.warn("warn.............");
        logger.fatal("warm...........");
        logger.error("error..........");
        return questionTypeMapper.selectList();
    }

    @Override
    public QuestionType findById(Integer id) {
        return null;
    }

    @Override
    public List<QuestionType> findAll(Pager pager) {
        return null;
    }

    @Override
    public int getDataCount() {
        return 0;
    }

    @Override
    public void insert(QuestionType object) {
        questionTypeMapper.insert(object);
    }

    @Override
    public void update(QuestionType object) {
        //questionTypeMapper.updateByPrimaryKey().update(object);
    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }
}
